Skip to content

Conversation

Jack251970
Copy link
Member

CHANGES

  • Use string resources instead of string constants for Flow Launcher
  • Use ShowMsgError instead of ShowMsg for error messages

@Jack251970 Jack251970 requested a review from Copilot July 20, 2025 04:40
@Jack251970 Jack251970 self-assigned this Jul 20, 2025
Copilot

This comment was marked as outdated.

Copy link

gitstream-cm bot commented Jul 20, 2025

🥷 Code experts: jjw24

Jack251970 has most 👩‍💻 activity in the files.
jjw24, Jack251970 have most 🧠 knowledge in the files.

See details

Flow.Launcher.Core/Configuration/Portable.cs

Activity based on git-commit:

Jack251970
JUL
JUN
MAY
APR 27 additions & 36 deletions
MAR
FEB

Knowledge based on git-blame:
jjw24: 68%
Jack251970: 21%

Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs

Activity based on git-commit:

Jack251970
JUL
JUN
MAY
APR 10 additions & 7 deletions
MAR
FEB 14 additions & 6 deletions

Knowledge based on git-blame:
Jack251970: 32%

Flow.Launcher.Core/Plugin/PluginManager.cs

Activity based on git-commit:

Jack251970
JUL 92 additions & 51 deletions
JUN 74 additions & 273 deletions
MAY 298 additions & 25 deletions
APR 73 additions & 68 deletions
MAR 42 additions & 37 deletions
FEB 276 additions & 198 deletions

Knowledge based on git-blame:
Jack251970: 41%
jjw24: 2%

Flow.Launcher.Core/Plugin/PluginsLoader.cs

Activity based on git-commit:

Jack251970
JUL
JUN
MAY
APR 11 additions & 7 deletions
MAR 5 additions & 14 deletions
FEB 34 additions & 15 deletions

Knowledge based on git-blame:
Jack251970: 20%
jjw24: 15%

Flow.Launcher.Core/Resource/Internationalization.cs

Activity based on git-commit:

Jack251970
JUL 3 additions & 2 deletions
JUN
MAY 31 additions & 13 deletions
APR 34 additions & 30 deletions
MAR 67 additions & 40 deletions
FEB 5 additions & 4 deletions

Knowledge based on git-blame:
Jack251970: 45%
jjw24: 7%

Flow.Launcher.Core/Updater.cs

Activity based on git-commit:

Jack251970
JUL
JUN
MAY
APR 35 additions & 21 deletions
MAR
FEB 22 additions & 22 deletions

Knowledge based on git-blame:
Jack251970: 23%
jjw24: 10%

Flow.Launcher.Infrastructure/Http/Http.cs

Activity based on git-commit:

Jack251970
JUL
JUN 21 additions & 2 deletions
MAY
APR 17 additions & 16 deletions
MAR
FEB

Knowledge based on git-blame:
Jack251970: 32%
jjw24: 2%

Flow.Launcher/App.xaml.cs

Activity based on git-commit:

Jack251970
JUL 42 additions & 7 deletions
JUN 6 additions & 0 deletions
MAY 51 additions & 28 deletions
APR 73 additions & 40 deletions
MAR 168 additions & 94 deletions
FEB 79 additions & 40 deletions

Knowledge based on git-blame:
Jack251970: 72%
jjw24: 4%

Flow.Launcher/Languages/en.xaml

Activity based on git-commit:

Jack251970
JUL 28 additions & 11 deletions
JUN 21 additions & 0 deletions
MAY 33 additions & 4 deletions
APR 22 additions & 21 deletions
MAR 67 additions & 42 deletions
FEB 15 additions & 9 deletions

Knowledge based on git-blame:
Jack251970: 18%
jjw24: 6%

Flow.Launcher/Resources/Pages/WelcomePage5.xaml.cs

Activity based on git-commit:

Jack251970
JUL
JUN
MAY 11 additions & 12 deletions
APR 42 additions & 23 deletions
MAR 7 additions & 6 deletions
FEB

Knowledge based on git-blame:
Jack251970: 55%

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

Activity based on git-commit:

Jack251970
JUL
JUN 2 additions & 0 deletions
MAY 15 additions & 4 deletions
APR 64 additions & 137 deletions
MAR 77 additions & 55 deletions
FEB 17 additions & 8 deletions

Knowledge based on git-blame:
Jack251970: 26%

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/en.xaml

Activity based on git-commit:

Jack251970
JUL
JUN 3 additions & 1 deletions
MAY
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 22%
Jack251970: 6%

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs

Activity based on git-commit:

Jack251970
JUL
JUN 6 additions & 6 deletions
MAY 3 additions & 2 deletions
APR 17 additions & 17 deletions
MAR 17 additions & 18 deletions
FEB

Knowledge based on git-blame:
Jack251970: 14%
jjw24: 10%

Plugins/Flow.Launcher.Plugin.Calculator/Languages/en.xaml

Activity based on git-commit:

Jack251970
JUL
JUN
MAY
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 75%

Plugins/Flow.Launcher.Plugin.Calculator/Main.cs

Activity based on git-commit:

Jack251970
JUL
JUN
MAY
APR
MAR 8 additions & 8 deletions
FEB

Knowledge based on git-blame:
jjw24: 33%
Jack251970: 4%

Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs

Activity based on git-commit:

Jack251970
JUL
JUN
MAY 23 additions & 0 deletions
APR 13 additions & 18 deletions
MAR
FEB

Knowledge based on git-blame:
jjw24: 51%
Jack251970: 7%

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

Activity based on git-commit:

Jack251970
JUL 2 additions & 0 deletions
JUN 7 additions & 0 deletions
MAY 10 additions & 2 deletions
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 22%
Jack251970: 10%

Plugins/Flow.Launcher.Plugin.Program/Main.cs

Activity based on git-commit:

Jack251970
JUL 1 additions & 1 deletions
JUN
MAY
APR 187 additions & 139 deletions
MAR
FEB 96 additions & 14 deletions

Knowledge based on git-blame:
Jack251970: 59%
jjw24: 6%

Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs

Activity based on git-commit:

Jack251970
JUL 1 additions & 2 deletions
JUN
MAY
APR 10 additions & 11 deletions
MAR
FEB

Knowledge based on git-blame:
Jack251970: 1%

Plugins/Flow.Launcher.Plugin.Shell/Languages/en.xaml

Activity based on git-commit:

Jack251970
JUL
JUN
MAY
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 63%

Plugins/Flow.Launcher.Plugin.Shell/Main.cs

Activity based on git-commit:

Jack251970
JUL
JUN 107 additions & 80 deletions
MAY 6 additions & 3 deletions
APR 34 additions & 29 deletions
MAR
FEB 3 additions & 4 deletions

Knowledge based on git-blame:
Jack251970: 27%
jjw24: 12%

Plugins/Flow.Launcher.Plugin.Url/Main.cs

Activity based on git-commit:

Jack251970
JUL
JUN
MAY
APR
MAR
FEB 1 additions & 9 deletions

Knowledge based on git-blame:
jjw24: 4%
Jack251970: 1%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

Copy link

gitstream-cm bot commented Jul 20, 2025

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Jul 20, 2025
Copy link
Contributor

coderabbitai bot commented Jul 20, 2025

Warning

Rate limit exceeded

@Jack251970 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 37 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1c76114 and d71d3a5.

📒 Files selected for processing (1)
  • Plugins/Flow.Launcher.Plugin.Program/Main.cs (1 hunks)
📝 Walkthrough

Walkthrough

This update systematically replaces hardcoded English error and notification messages with localized string lookups throughout core and plugin components. It also standardizes error message display by switching from generic message dialogs to dedicated error dialogs. Several files now cache the public API instance for efficiency, and new translation keys are added to language resource files.

Changes

Files/Groups Change Summary
Flow.Launcher.Core/Configuration/Portable.cs, Flow.Launcher.Core/Plugin/PluginsLoader.cs Replaced hardcoded English messages with calls to API.GetTranslation for localization in user-facing dialogs and notifications.
Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs, Flow.Launcher.Core/Resource/Internationalization.cs, Flow.Launcher.Infrastructure/Http/Http.cs Introduced private static fields and properties to cache/lazily initialize the IPublicAPI instance, replacing direct IoC service retrievals. Updated usages to reference the cached property.
Flow.Launcher.Core/Plugin/PluginManager.cs, Flow.Launcher.Core/Updater.cs, Flow.Launcher/App.xaml.cs, Flow.Launcher/Resources/Pages/WelcomePage5.xaml.cs, Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs Changed error message display methods from ShowMsg to ShowMsgError in exception handling, enhancing consistency and specificity of error dialogs.
Flow.Launcher/Languages/en.xaml, Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/en.xaml, Plugins/Flow.Launcher.Plugin.Calculator/Languages/en.xaml, Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml, Plugins/Flow.Launcher.Plugin.Shell/Languages/en.xaml Added new localized string resources for error and notification messages, supporting new and updated error reporting in core and plugin components.
Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs, Plugins/Flow.Launcher.Plugin.Calculator/Main.cs Replaced hardcoded error messages with localized translations when clipboard copy fails; updated error dialogs to use ShowMsgError.
Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs Standardized all error messages to use localized translations and ShowMsgError; removed intermediate string variables and improved error logging consistency for file/clipboard operations.
Plugins/Flow.Launcher.Plugin.Program/Main.cs, Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs, Plugins/Flow.Launcher.Plugin.Url/Main.cs Updated error dialogs from ShowMsg to ShowMsgError in exception handling for process start and URL opening failures.
Plugins/Flow.Launcher.Plugin.Shell/Main.cs Switched error dialogs to ShowMsgError with localized messages for command execution failures; added logging for unexpected exceptions.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant API
    participant Translation
    participant Logger

    User->>UI: Triggers action (e.g., copy, delete, run command)
    UI->>API: Perform action
    alt Success
        API-->>UI: Action result
    else Exception occurs
        API->>Translation: Get localized error string
        API->>Logger: Log exception
        API->>UI: ShowMsgError(localized message)
    end
Loading

Possibly related PRs

  • #3175: Modifies Portable.cs to centralize message display via IPublicAPI, directly overlapping with this PR's changes to localization and error dialogs in the same file.

Suggested labels

bug

Suggested reviewers

  • jjw24
  • onesounds
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs (1)

226-227: LGTM! Improved error handling with proper localization.

The changes effectively improve error handling by:

  1. Using ShowMsgError instead of ShowMsg for proper error categorization
  2. Implementing localization through the translation key flowlauncher_plugin_browserbookmark_copy_failed

These changes align well with the PR objectives for standardizing error displays and supporting translations.

Consider using a consistent approach for the log message as well:

-                        _context.API.LogException(ClassName, "Failed to set url in clipboard", e);
+                        _context.API.LogException(ClassName, _context.API.GetTranslation("flowlauncher_plugin_browserbookmark_copy_failed"), e);

This would maintain consistency between user-facing messages and log entries.

@Jack251970 Jack251970 added this to the 2.0.0 milestone Jul 20, 2025
@coderabbitai coderabbitai bot added the bug Something isn't working label Jul 20, 2025
Jack251970 and others added 2 commits July 20, 2025 12:57
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@Jack251970 Jack251970 requested a review from Copilot July 20, 2025 04:58
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements comprehensive internationalization (i18n) for Flow Launcher by replacing hardcoded string constants with translatable string resources and improving error message presentation.

  • Replace hardcoded error messages with translatable resources across plugins and core components
  • Convert regular message displays to error-specific message displays for better user experience
  • Add new translation keys to language resource files for all newly internationalized messages

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Plugins/Flow.Launcher.Plugin.Url/Main.cs Use ShowMsgError instead of ShowMsg for URL opening failures
Plugins/Flow.Launcher.Plugin.Shell/Main.cs Replace hardcoded error messages with translations and add exception handling
Plugins/Flow.Launcher.Plugin.Shell/Languages/en.xaml Add translation keys for shell command errors
Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs Remove unused empty string parameter from ShowMsgError call
Plugins/Flow.Launcher.Plugin.Program/Main.cs Fix duplicate string formatting and use ShowMsgError
Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml Add translation keys for explorer operation errors
Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs Replace hardcoded error messages with translations
Plugins/Flow.Launcher.Plugin.Calculator/Main.cs Use translation for copy failure message
Plugins/Flow.Launcher.Plugin.Calculator/Languages/en.xaml Add translation key for copy failure
Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs Replace hardcoded error message with translation
Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/en.xaml Add translation key for bookmark copy failure
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs Use ShowMsgError and add translations for Korean IME settings
Flow.Launcher/Resources/Pages/WelcomePage5.xaml.cs Use ShowMsgError for startup configuration errors
Flow.Launcher/Languages/en.xaml Add extensive translation keys for various error scenarios
Flow.Launcher/App.xaml.cs Use ShowMsgError for auto-startup failures
Flow.Launcher.Infrastructure/Http/Http.cs Replace hardcoded HTTP proxy error with translations
Flow.Launcher.Core/Updater.cs Use ShowMsgError for update failures
Flow.Launcher.Core/Resource/Internationalization.cs Use API property instead of direct service access
Flow.Launcher.Core/Plugin/PluginsLoader.cs Replace hardcoded plugin error messages with translations
Flow.Launcher.Core/Plugin/PluginManager.cs Use ShowMsgError for plugin uninstallation failures
Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs Use API property instead of direct service access
Flow.Launcher.Core/Configuration/Portable.cs Replace hardcoded portable mode messages with translations
Comments suppressed due to low confidence (2)

Flow.Launcher.Infrastructure/Http/Http.cs:24

  • [nitpick] The field name 'api' should follow C# naming conventions and be capitalized as '_api' or use a more descriptive name like '_apiInstance' to match the pattern used in other files.
        private static IPublicAPI api = null;

Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs:26

  • [nitpick] The field name 'api' should follow C# naming conventions and be capitalized as '_api' or use a more descriptive name like '_apiInstance' to match the pattern used in other files.
        private static IPublicAPI api = null;

@jjw24 jjw24 enabled auto-merge July 20, 2025 05:07
@jjw24 jjw24 removed enhancement New feature or request 5 min review labels Jul 20, 2025
@jjw24 jjw24 merged commit ff2d5e8 into dev Jul 20, 2025
15 checks passed
@jjw24 jjw24 deleted the translations branch July 20, 2025 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants